I can confirm there is something wrong in iOS 17.0.
My UnitTests tests that check the correct resolved colors when changing the userinterface style.
I debugged the trait collection before and after setting "overrideUserInterfaceStyle = .dark"
iOS 16.4 ✅
Before <UITraitCollection: … UserInterfaceStyle = Light, ….>
After <UITraitCollection: …UserInterfaceStyle = Dark, …>
iOS 17 ❌
<UITraitCollection: ... UserInterfaceStyle = Light, …>
<UITraitCollection: … UserInterfaceStyle = Light, …>